//----------------------------------------------------------------------------
// M A R I T I M E  R E S E A R C H  I N S T I T U T E  N E T H E R L A N D S
//----------------------------------------------------------------------------
// Copyright (C) 2012 - MARIN - All rights reserved - http://www.marin.nl
//----------------------------------------------------------------------------
// Program    : mermaid
// Module     : vbm
// File       : shiftzetaphi.h
// Author     : M.A. de Jong
//----------------------------------------------------------------------------

#ifndef SHIFTZETAPHI_H
#define SHIFTZETAPHI_H

#include "kernels/shiftzetaphi_kernels.h"

namespace wavescomputer
{

template <class T>
inline void shiftzetaphi(T* zetam2, T* zetam1, const T* zeta,
                  T* phim2,  T* phim1,  const T* phi,
                  T* dt_zetam1, const T* dt_zeta,
                  T* dt_phim1,  const T* dt_phi,
                  const T eps,
                  const int nx, const int ny)
{
    dimGrid.x = nx / NUM_THREADS_X;
    dimGrid.y = ny / NUM_THREADS_Y;
    dimBlock.x = NUM_THREADS_X;
    dimBlock.y = NUM_THREADS_Y;

    kernel_shiftzetaphi<T> <<< dimGrid, dimBlock >>> 
        (zetam2, zetam1, zeta,
         phim2, phim1, phi,
         dt_zetam1, dt_zeta,
         dt_phim1, dt_phi,
         eps, nx);
    checkCudaError(cudaGetLastError(), "wavescomputer::kernel_shiftzetaphi");
}

} // namespace wavescomputer

#endif // SHIFTZETAPHI_H

